home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5273 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: Rezonet.net!altitude!usenet
  2. From: pifus@cam.org (David Taylor)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Q: Good C++ UNDO Design
  5. Date: 31 Jan 1996 18:15:26 GMT
  6. Organization: Communications Accessibles Montreal
  7. Message-ID: <4eobju$roh@tandem.CAM.ORG>
  8. References: <4eit9g$c6j@news1.halcyon.com>
  9. NNTP-Posting-Host: pifus.hip.cam.org
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.6
  13.  
  14. In article <4eit9g$c6j@news1.halcyon.com>, riston@coho.halcyon.com says...
  15. >
  16. >
  17. >I have been charged with designing an undo mechanism for a large graphical
  18. >Windows (32bit) application.  This application is the classic 'draw a 
  19. >shape' program (box, circle, line, OLE object, or whatever).   I would like 
  20. >to know if anybody has any elegant designs for handling undo operations.  I 
  21. >am working with Visual C++ 4.0 and MFC for the implementation.  I
  22. >am well versed in C++.
  23. >
  24.  
  25. I have no source code, but if you want to see how it should work from a
  26. users perspective check out the Describe wordprocessor (it's about $50).
  27. Instead of the usual Undo/Redo menu options, there is a dialog box with 
  28. a slider bar which allows you to slide back and forth through 
  29. the complete history of operations.  Two ways I can see of doing this 
  30. is make every operation reversible which is more complicated, or only 
  31. keep a copy of the original document and apply the users instructions 
  32. to it up to the current undo/redo level, which would be simple but slow.
  33. Either way you need some sort of stack of instructions, perhaps using 
  34. an internal macro or symbolic language.
  35.  
  36. Dave
  37.  
  38.